package com.mocha.bss.feign.general.api.fallback;


import com.coffee.core.CoffeeResponse;
import com.coffee.excel.MochaExcelSheet;
import com.coffee.log.capture.OperationLogBO;
import com.mocha.bss.feign.general.api.MochaExcelFieldFeign;
import com.mocha.bss.feign.general.api.MochaOperationLogFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MochaOperationLogFeignFallback implements FallbackFactory<MochaOperationLogFeign> {
    @Override
    public MochaOperationLogFeign create(Throwable cause) {
        return new MochaOperationLogFeign(){
            @Override
            public CoffeeResponse<?> dispose(OperationLogBO operationLogBO) {
                log.error("MochaExcelFieldFeign findFields Throwable: {}", cause.getMessage());
                return null;
            }

        };
    }


}
